package com.shr.exam.souhu;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main1 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in) ;
		String unixPath = sc.nextLine() ;
		String[] pathArray = unixPath.split("/+") ;
		List<String> pathList = new ArrayList<>() ; 
		boolean flag = false ;
		for(int i = 0;i<pathArray.length;i++){
			if(".".equals(pathArray[i]) || "".equals(pathArray[i]))
				continue ;
			else if("..".equals(pathArray[i])){
				if(pathList.isEmpty()){
					flag = true;
					break ;
				}
				pathList.remove(pathList.size() - 1) ;
			}else pathList.add(pathArray[i]) ;
		}

		if(flag)
			System.out.println("/");
		else{
			StringBuffer sb = new StringBuffer("/") ;
			for(int i = 0;i<pathList.size()-1;i++){
				sb.append(pathList.get(i)+"/") ;
			}
			if(!pathList.isEmpty())
				sb.append(pathList.get(pathList.size() - 1)) ;
			System.out.println(sb.toString());
		}
		sc.close();
	}
}
